home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / byte1286.arc / BLAST.BAS < prev    next >
BASIC Source File  |  1986-12-05  |  6KB  |  152 lines

  1. 10 REM                          LISTING 1
  2. 20 REM
  3. 30 REM NUCLEAR BLAST CALCULATION
  4. 40 REM (C) JOHN R. FANCHI, JUNE 1985
  5. 50 REM MICROSOFT BASIC FOR CP/M-80 OPERATING SYSTEM
  6. 60 REM PART OF THIS CODE IS EXCERPTED FROM J.R. FANCHI'S 
  7. 70 REM ADVENTURE SIMULATION GAME "NUCLEAR SURVIVAL"
  8. 80 REM CHR$(26) CLEARS THE SCREEN
  9. 90 DIM ANSER$(2)
  10. 100 PRINT CHR$(26)
  11. 110 PRINT TAB(20); "*** NUCLEAR BLAST CALCULATION ***"
  12. 120 PRINT
  13. 130 PRINT TAB(21);"(C) John R. Fanchi, JUNE 1985"
  14. 140 PRINT
  15. 150 PRINT "The calculations performed here are based on information published"
  16. 160 PRINT "by the American Institute of Physics."
  17. 170 PRINT
  18. 180 INPUT "HIT CARRIAGE RETURN WHEN YOU ARE READY TO PROCEED";ICAR$
  19. 190 PRINT CHR$(26)
  20. 200 PRINT
  21. 210 INPUT "Specify your slant range (distance) from the blast in miles";D
  22. 220 PRINT
  23. 230 REM .............................DETERMINE WEAPON YIELD (Y)
  24. 240 PRINT "Specify the yield of the blast in megatons.  Typical values range"
  25. 250 INPUT "from 0.8 to 20 megatons";Y
  26. 260 REM .................................DETERMINE BLAST HEIGHT
  27. 270 PRINT
  28. 280 INPUT "Specify the height of the blast in feet";H
  29. 290 PRINT
  30. 300 PRINT "Specify the thermal energy fraction.  This is the fraction of heat"
  31. 310 PRINT "energy in the nuclear fireball.  It should be between 0 and 1.  A"
  32. 320 INPUT "typical value is 0.35";TEF
  33. 330 PRINT
  34. 340 REM .............................DETERMINE TRANSMISSION FACTOR
  35. 350 PRINT "Specify the atmospheric transmission factor.  It should be between"
  36. 360 INPUT "0 (very cloudy day) and 1 (perfectly clear day)"; TAU
  37. 370 PRINT
  38. 380 REM ...............................CALC BLAST EFFECTS
  39. 390 REM THERMAL FLUX Q
  40. 400   Q=3000*TEF*TAU*Y/(D*D)
  41. 410 REM BLAST OVERPRESSURE P
  42. 420   Z=(Y^(.333))/D
  43. 430   P=22.4*(Z^3) + 15.8*(Z^(1.5))
  44. 440 REM EMP RANGE
  45. 450   EMP=SQR(2*H*3963/5280)
  46. 460 REM RADIATION DOSAGE REM
  47. 470   REMS=250*1000*Y/(16*3.1416*D*D)
  48. 480 PRINT
  49. 490 PRINT "The NUCLEAR BLAST had the following effects:"
  50. 500 PRINT
  51. 510 PRINT TAB(10);"THERMAL FLUX (cal/sq cm)";TAB(50);Q
  52. 520 PRINT TAB(10);"OVERPRESSURE (lb/sq in)";TAB(50);P
  53. 530 PRINT TAB(10);"EMP RANGE (miles)";TAB(50);EMP
  54. 540 PRINT TAB(10);"RADIATION DOSAGE (rems)";TAB(50);REMS
  55. 550 PRINT
  56. 560 INPUT "HIT CARRIAGE RETURN WHEN YOU ARE READY TO PROCEED";ICAR$
  57. 570 PRINT CHR$(26)
  58. 580 PRINT
  59. 590 REM ...............................OVERPRESSURE EFFECTS
  60. 600 IF P<20 THEN 640
  61. 610 PRINT "Overpressure has caused winds in excess of 500 miles per hour."
  62. 620 PRINT "Even multi-story reinforced concrete buildings are leveled. "
  63. 630 GOTO 820
  64. 640 REM
  65. 650 IF P<10 THEN 700
  66. 660 PRINT "Overpressure has caused winds in excess of 300 miles per hour."
  67. 670 PRINT "Most factories and commercial buildings are leveled, as are small"
  68. 680 PRINT "wood and brick residences."
  69. 690 GOTO 820
  70. 700 REM
  71. 710 IF P<5 THEN 750
  72. 720 PRINT "Overpressure has caused winds in excess of 160 miles per hour."
  73. 730 PRINT "Unreinforced brick and wood houses are leveled. "
  74. 740 GOTO 820
  75. 750 REM
  76. 760 IF P<2 THEN 790
  77. 770 PRINT "Overpressure has caused winds in excess of 70 miles per hour."
  78. 780 GOTO 820
  79. 790 REM
  80. 800 PRINT "Overpressure has not had a significant effect on wind conditions"
  81. 810 PRINT "or the structures of buildings."
  82. 820 REM
  83. 830 PRINT
  84. 840 REM ...............................THERMAL EFFECT
  85. 850   IF Q<10 THEN 880
  86. 860   PRINT "Thermal flux has burned you to a crisp."
  87. 870   GOTO 980
  88. 880 REM
  89. 890 IF Q<5 THEN 920
  90. 900   PRINT "You have suffered third degree burns because of THERMAL FLUX."
  91. 910   GOTO 980
  92. 920 REM
  93. 930 IF Q<1 THEN 960
  94. 940   PRINT "You have suffered second degree burns because of THERMAL FLUX."
  95. 950   GOTO 980
  96. 960 REM
  97. 970   PRINT "THERMAL FLUX has added to your tan. "
  98. 980 PRINT
  99. 990 REM ...............................RADIATION EFFECTS PRINT
  100. 1000 PRINT
  101. 1010 IF REMS<5000 THEN 1050
  102. 1020   PRINT "You are experiencing convulsions, tremors and ataxia because"
  103. 1030   PRINT "of RADIATION exposure.  No treatment will help you."
  104. 1040   GOTO 1330
  105. 1050 REM
  106. 1060 IF REMS<1000 THEN 1120
  107. 1070    PRINT "You have diarrhea, fever and a disturbance of your body "
  108. 1080    PRINT "chemistry because of RADIATION exposure.  Treatment may"
  109. 1090    PRINT "alleviate pain, but it will not save your life.  You have"
  110. 1100    PRINT "less than 2 weeks to live. "
  111. 1110    GOTO 1330
  112. 1120 REM
  113. 1130 IF REMS<600 THEN 1190
  114. 1140    PRINT "You have very severe leukopenia and internal bleeding."
  115. 1150    PRINT "You have also developed ulcers and infection is likely because"
  116. 1160    PRINT "of RADIATION exposure.  You need hospitalization but none is"
  117. 1170    PRINT "available, therefore you have less than a month to live."
  118. 1180    GOTO 1330
  119. 1190 REM
  120. 1200 IF REMS<200 THEN 1250
  121. 1210    PRINT "Your symptoms range from leukopenia to hair loss because of"
  122. 1220    PRINT "RADIATION exposure.  Hospitalization is required and is"
  123. 1230    PRINT "available to you because you have a reasonable chance to live."
  124. 1240    GOTO 1330
  125. 1250 REM
  126. 1260 IF REMS<100 THEN 1310
  127. 1270    PRINT "RADIATION exposure has made you sick--vomiting, headache, some"
  128. 1280    PRINT "loss of white blood cells and dizziness.  This is good.  You"
  129. 1290    PRINT "will completely recover."
  130. 1300    GOTO 1330
  131. 1310 REM
  132. 1320    PRINT "You have survived RADIATION exposure with NO effects."
  133. 1330 PRINT
  134. 1340 REM ...............................EMP EFFECT
  135. 1350 IF D>EMP THEN 1410
  136. 1360 PRINT "Your distance from the blast is within the range of the "
  137. 1370 PRINT "electromagnetic pulse (EMP).  The EMP is capable of burning"
  138. 1380 PRINT "out electrical instruments."
  139. 1390 PRINT
  140. 1400 GOTO 1440
  141. 1410 REM
  142. 1420 PRINT "You are outside the range of the electromagnetic pulse (EMP)."
  143. 1430 PRINT
  144. 1440 PRINT
  145. 1450 INPUT "Do you wish to try again (Y/N)";IANS$
  146. 1460 PRINT
  147. 1470 IF IANS$="Y" THEN 100
  148. 1480 SYSTEM
  149. 1490 END
  150. 
  151. 1440 PRINT
  152. 1450 INPUT "Do you wish to try again (Y/N)";IANS$